Andrew Hunt and David Thomas, The Pragmatic Programmer, p. 102.
Java Dwarf Manager contains numerous examples of repeated information suitable for code generation. A Python script can read a XML description of a class and generate both JavaBean class source and Java code for database access. The XML can be validated using a XML DTD. The code generation can be done either entirely inside the script or use template substitution.
For more code generation, see Ruby Code Generator which is used to generate EJB Entity Beans and associated XML deployment descriptors from the SQL schema.
Props to Jack Herrington, who first showed me these code generation techniques (in Perl ;-). Code generation is not a new idea; there are over 400 Open Source code generator projects on Sourceforge.